home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
BMUG Revelations
/
BMUG Revelations.toast
/
Programming
/
Programming Languages
/
Yerk 3.64
/
Module source
/
qPrint
< prev
next >
Wrap
Text File
|
1990-12-22
|
1KB
|
44 lines
\ qprint - quick printer for Yerk source files
\ 4/24/86 rfd re-written to handle Mocwrite 4.2a tabs
\ 9/19/86 cdn re-written while handling tabs in grep
\ 9/01/88 rfl date now revision date - must use revised date source
\ 9/13/88 rfl added getfileinfo:
:Module qpMod
// date
: .footer pcr pcr 5 spaces
." Yerk source file: " getName: topFile mfsname ptype
3 spaces topfile 76 + @ put: sysdate ." Rev: " print: sysDate
7 spaces ." Page" . pcr np ;
String linBuf
\ get file and print it
: qPrint { \ theLine thePage ubase -- }
new: linBuf
base -> ubase decimal
'c drop -> emitVec 'c 2drop -> typeVec
1 -> theLine 1 -> thePage +print
openReadOnly: topFile ?error 132 getfileinfo: topfile drop
BEGIN
topFile 255 readLine: linBuf 0=
WHILE
start: linBuf \ expand tabs
BEGIN 9 charOf: linBuf
WHILE 4 mod 4 swap - >R pad 1 " " drop R> replace: linBuf
REPEAT
theLine 5 .r space get: linBuf 90 min ptype pcr 1 ++> theLine
theLine 58 mod 0=
IF thePage .footer 1 ++> thePage THEN
REPEAT
theLine 58 mod 58 swap - 0
DO pcr LOOP thePage .footer
-print 0 -> emitvec 0 -> typevec
release: linBuf
ubase -> base
;
;Module